#include "LocalScene.h"
#include "Utils/LogUtil.h"
#include "LocalEntity.h"
#include "Utils/StringUtil.h"
#include "Game/Component/Model.h"
#include "Render/RenderState.h"
#include "Render/Imgui/imgui.h"
#include "Math/Random.h"


void LocalScene::OnInit()
{
	mSkyboxProcess = GetProcess<SkyboxProcess>("SkyboxProcess");
	mCoordinateProcess = GetProcess<CoordinateProcess>("CoordinateProcess");

	mUseBloom = true;
}

void LocalScene::OnExit()
{

}

void LocalScene::OnTick(float deltaTime)
{

}

void LocalScene::OnImgui()
{
	GameScene::OnImgui();

	ImGui::SetNextWindowPos(ImVec2(20, 20), ImGuiCond_FirstUseEver);

	ImGui::Begin("HdrSimple");

	ImGui::InputFloat("Exposure", &mSkyboxProcess->mExposure, 0.025f, 0.25f);

	if (ImGui::Checkbox("UseBloom", &mUseBloom))
	{
		if (mUseBloom)
		{
			mCoordinateProcess->UpdateColorRenderTarget(PREV_PROCESS, "ColorRenderTarget");
		}
		else
		{
			mCoordinateProcess->UpdateColorRenderTarget("SkyboxProcess", "ColorRenderTarget0");
		}
	}

	ImGui::End();
}
